﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Xml;
using System.IO;

namespace FileParser
{
    /// <summary>
    /// This class was created as a container that is going to store the 
    /// relevant information, then included into an ArrayList among with 
    /// the class name, which would then be passed to the graphics module
    /// </summary>
    public class C_DataStructure
    {
        private String name;
        private ArrayList variables;
        private ArrayList functions;
        private string summary;
        private string inheritance;
        private string refid;

        ///Constructor passing a string as a file name
        public C_DataStructure(string name)
        {
            this.name = name;
            variables = new ArrayList();
            functions = new ArrayList();
            summary = refid = inheritance = "";
        }

        ///Constructor passing class name and its attributes and characteristics
        public C_DataStructure(string iname, string iref, string iheir, string[] vars, string[] functs)
        {
            name = iname;
            variables = new ArrayList(vars);
            functions = new ArrayList(functs);
            summary = "";
            refid = iref;
            inheritance = iheir;
        }

        ///This section define the getters and setters methods for the attributes of the class
        public int GetNumVariables()
        {
            return variables.Count;
        }

        public int GetNumFunctions()
        {
            return functions.Count;
        }

        public void AddVariable(String variable)
        {
            variables.Add(variable);
        }

        public void AddFunction(String function)
        {
            functions.Add(function);
        }

        public ArrayList GetVariables()
        {
            return variables;
        }

        public ArrayList GetFunctions()
        {
            return functions;
        }

        ///This method overrides the ToString method to print the data in the container. For debugging purposes
        public override String ToString() 
        {
            //return name + " variables: " + numbVariables + " functions: " + numbFunctions;
            return "\nClass name: " + name + "\nrefid: " + refid + "\ninheritance: " + inheritance + "\n";
        }

        public String GetName() 
        {
            return name;
        }

        public void SetInheritance(string inheritance)
        {
            this.inheritance = inheritance;
        }

        public void SetRefId(string refid)
        {
            this.refid = refid;
        }

        public void SetSummary(string summary)
        {
            this.summary = summary;
        }

        public String GetRefId() {
            return refid;
        }

        public String GetSummary()
        {
            return summary;
        }

        public String GetInheritance()
        {
            return inheritance;
        }
    }
}
